# Maintainer: Daurnimator <daurnimator@archlinux.org>

pkgname=('lua-fifo' 'lua51-fifo' 'lua52-fifo' 'lua53-fifo')
pkgver=0.2
pkgrel=1
arch=('any')
url='https://github.com/daurnimator/fifo.lua'
license=('MIT')
source=("$pkgname-$pkgver.tar.gz::https://github.com/daurnimator/fifo.lua/archive/$pkgver.tar.gz")
sha256sums=('85cad0c2f9eac1cd3e08c5134feb655e0b928e1e22363c3ef3293a194c0eb53f')

package_lua-fifo() {
	pkgdesc='Fifo library for Lua 5.4'

	cd "fifo.lua-$pkgver"
	install -Dm644 fifo.lua "$pkgdir/usr/share/lua/5.4/fifo.lua"
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_lua51-fifo() {
	pkgdesc='Fifo library for Lua 5.1'

	cd "fifo.lua-$pkgver"
	install -Dm644 fifo.lua "$pkgdir/usr/share/lua/5.1/fifo.lua"
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_lua52-fifo() {
	pkgdesc='Fifo library for Lua 5.2'

	cd "fifo.lua-$pkgver"
	install -Dm644 fifo.lua "$pkgdir/usr/share/lua/5.2/fifo.lua"
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_lua53-fifo() {
	pkgdesc='Fifo library for Lua 5.3'

	cd "fifo.lua-$pkgver"
	install -Dm644 fifo.lua "$pkgdir/usr/share/lua/5.3/fifo.lua"
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
